package binary;

import com.sun.xml.internal.ws.addressing.WsaActionUtil;

/**
 *
 */
public class BinaryDemo {
    public static void main(String[] args) {
       /*
        int n=45;
        System.out.println(Integer.toBinaryString(n));//101101
        System.out.println(n);//45
        n++;
        System.out.println(Integer.toBinaryString(n));//101110
        System.out.println(n);//46
        //0010 0011 1101 1100 1100  1010-- 23dcca
        //0010 1001 1011 0110 0011 0101--- 29b635
        //1000 1111 0011 0101 1000 1001--8f3589
        //0001 1100 0111 0100 0110 0000 1111--1c7460f

        */

        int n=0x2fd47b;
        int m=0b001011111101010001111011;
        System.out.println(Integer.toBinaryString(n));//按2进制输出
        System.out.println(Integer.toBinaryString(m));

        System.out.println(Integer.toHexString(n));//按16进制输出
        System.out.println(Integer.toHexString(m));

        System.out.println(n);//按10进制输出
        System.out.println(m);
    }
}
